package com.wmh.baseservice.operationaid.controller;

import com.wmh.baseservice.operationaid.pojo.vo.task.UpDateTitleReqVO;
import com.wmh.baseservice.operationaid.pojo.vo.task.UpdateTitleOrZtcAddKeyWordReqVO;
import com.wmh.baseservice.operationaid.service.TaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

import static com.wmh.baseservice.common.utils.returnbody.ReturnBody.success;

/**
 * @author 谢骏
 * @date 2023/6/9 9:41
 **/
@Validated
@RestController
@RequestMapping("operationAid/task")
@Api(tags = "运营助手-自动化任务")
public class TaskController {

    @Resource
    private TaskService taskService;

    @ApiOperation("修改标题和添加直通车关键词")
    @PostMapping("/updateTitleOrZtcAddKeyWord")
    public String updateTitleOrZtcAddKeyWord(@Valid UpdateTitleOrZtcAddKeyWordReqVO reqVO) {
        taskService.updateTitleOrZtcAddKeyWord(reqVO);
        return success();
    }

    @ApiOperation("修改商品标题")
    @PostMapping("/updateTitle")
    public String updateTitle(@Valid UpDateTitleReqVO reqVO){
        taskService.updateTitle(reqVO);
        return success();
    }
}
